package com.atguigu.day05

object Text02 {
  def main(args: Array[String]): Unit = {
    val tuple: (Int, String, Boolean) = (40, "abc", true)
    //访问元组
    //顺序访问
    println(tuple._1)
    println(tuple._2)
    println(tuple._3)
    //索引访问
    println("===========")
    println(tuple.productElement(0))
    //迭代器访问
    println("==============")
    for (elem <- tuple.productIterator) {
      println(elem)

    }
    println("==============")
    val map: Map[String, Int] = Map(("a",1),("b",2),("c",3))
    map.foreach(tuple=>{println(tuple._1 + "=" + tuple._2)})

    println("++++++++++++++++++")
    val list: List[Int] = List(3,4,5,6,7,8,9)
    println(list.mkString("/"))
    println(list.contains(4))
  }
}
